package com.qf.commerce.controller;

import com.github.pagehelper.PageHelper;
import com.qf.commerce.entity.Production;
import com.qf.commerce.resp.ResponseResult;
import com.qf.commerce.service.ProductionService;
import com.qf.commerce.vo.CommodityEvaluateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author peng
 * @Date 2023/9/13 21:23
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/production")
public class ProductionController {
    @Autowired
    private ProductionService productionService;
//    展示所以订单信息
    @GetMapping("/selectproductionList")
    public ResponseResult<List<Production>> selsctProductionList(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "2") int size, Production production){
        return ResponseResult.success(productionService.selsctProductionList(page,size,production));

    }
//    批量生产
    @PutMapping("/updateProduction")
    public ResponseResult<Integer> updateProducyionListStatus(@RequestBody List<Long> producyionId) {
        return ResponseResult.success(productionService.updateProducyionListStatus(producyionId));
    }
//    批量入库
@PutMapping("/updateProductionList")
    public ResponseResult<Integer> updateProducyionbePutInStorage(@RequestBody List<Long> producyionId) {
        return ResponseResult.success(productionService.updateProducyionbePutInStorage(producyionId));
    }
}
